<?php header("Content-Type:text/html;   charset=utf-8"); ?>
<script type="text/javascript">
	$(function(){
		loadSms();		
		$("#btnQuerySms").bind("click",loadSms);
		$("#hrefDelSms").bind("click",delSelectSms);
		$("#hrefAddSms").bind("click",addSms);						
	});	
	function delSelectMultiSms(ids){
		var params={ids:ids};
 	 	var url="admin.php/manage/delSms";
 	 	$.ajax({
 	 	 	type:"post",
 	 	 	url:url,
 	 	 	dataType:"json",
 	 	 	data:params,
 	 	 	success:function(data){
 	 	 	 	
				if(data.ReturnCode=="1"){
					loadSms();
					alert('删除成功');
				}else{
					alert('删除失败');
				}
 	 	 	}
 	 	});
	}
 	function delSelectSms(){
 	 	var selIds=getSelectIdsSms();
 	 	if(selIds==""){
 	 	 	alert('请选择要删除的项');
 	 	 	return;
 	 	}
 	 	if(confirm('删除后不可恢复，确认要删除吗？')==false)
 	 	 	return; 	
 	 	delSelectMultiSms(selIds);	
 	}
 	function delSms(id){
 	 	if(confirm('确定要删除吗？')==false)
 	 	 	return;
 	 	delSelectMultiSms(id);
 	}
 	
	function getSelectIdsSms(){
		var sel = "";
		$("#tableSms td :checkbox:checked").each(function(){
			sel+=$(this).val()+",";
		});
		return sel;
	}		
	function loadSms(){
		$("#chkSelectAllSms").attr("checked",false);		
		var url="admin.php/manage/loadSms";
		$.ajax({
			type:"post",
			url:url,
			dataType:"html",			
			success:function(data){
				$("#tableSms").html(data);
				bindSelect("chkSelectAllSms","tableSms");				
			}
		});	
	}
	function modifySms(id){		
		$("#hrefEditSms").attr("href","admin.php/manage/newsms?id="+id);
		$("#hrefEditSms").trigger("click");
	}
	function addSms(){
		$("#hrefEditSms").attr("href","admin.php/manage/newsms");
		$("#hrefEditSms").trigger("click");
	}
</script>

<div class="pageHeader">
	<form>
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>
						<div class="subBar">
							<ul>
								<li><div class="buttonActive">
										<div class="buttonContent">
											<button id="btnQuerySms" type="button" style="width: 100px">查&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;询</button>
										</div>
									</div></li>
							</ul>
						</div>
					</td>
				</tr>
			</table>

		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li style="display: none"><a id="hrefEditSms" class="edit" href=""
				lookupgroup="orgLookup"><span>修改</span></a></li>
			<li><a id="hrefAddSms" class="add" href="javascript:void(0)"><span>新建站内信</span></a></li>
			<li><a id="hrefDelSms" class="delete" href="javascript:void(0)"><span>删除</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th style='width: 30px; text-align: center;'><input type='checkbox'
					id='chkSelectAllSms' /></th>
				<th style='width: 40px'>编号</th>
				<th style='width: 200px'>消息标题</th>
				<th style='width: 100px'>发送用户</th>
				<th style='width: 60px'>发送时间</th>
				<th style='width: 260px'>消息备注</th>				
				<th style='width: 60px'>操作</th>

			</tr>
		</thead>
		<tbody id="tableSms">

		</tbody>
	</table>
</div>





























